package com.bonc.event.extractor;

import java.util.Map;
import java.util.Set;

/**
 * @author donggui@bonc.com.cn
 * @version 2016 2016年6月28日 下午2:58:38
 */
public class EventModel {
	
	private String language;

	/**
	 * Map of {@link Trigger}s and the set of {@link Rule}s which should be
	 * applied for the given {@link Trigger}
	 */
	private Map<Trigger, Set<Rule>> rules;

	public EventModel(String language, Map<Trigger, Set<Rule>> rules) {
		if (language == null || language.equals("")) {
			throw new IllegalArgumentException("language must not be null or empty");
		}

		if (rules == null || rules.isEmpty()) {
			throw new IllegalArgumentException("rules must not be null or empty");
		}

		this.language = language;
		this.rules = rules;
	}

	public String getLanguage() {
		return language;
	}

	public Set<Rule> getRules(Trigger trigger) {
		return rules.get(trigger);
}
}
